import {createApp} from 'vue';
import {designPage} from "plain-ui-composition";
import {createCmsPreview} from "../../components/CmsPreview";
import '../../main.scss';
import {useRemoveData} from "../index/useRemoteData";
import {predefineActionRender} from "../public/predefineAction.render";
import {reactivityApi} from "../../packages/utils/vueReactivityApi";

const Preview = designPage(() => {
  const data = useRemoveData();
  const CmsPreview = createCmsPreview({ api: reactivityApi, processActionRender: predefineActionRender });
  return () => (
    !!data.value && <CmsPreview data={data.value}/>
  );
});

createApp(<Preview/>).mount('#app');
